package model.mobs;

import param.GraphicsParam;
import graphic.Assets;
import model.Coordinate;
import model.Hitable;
import model.entity.Entity2D;

/**
 * Primo Mob.
 * @author Jan
 *
 */
public class Mob2D extends Entity2D implements Hitable {
	
	private int lives = 1;
	
	public Mob2D(int entityID, Coordinate coordinate, int shiftAmount) {
		super(entityID, coordinate, shiftAmount);
		setSprite(Assets.getsLoader().getSprite(Assets.SPRITE_MOB_2D));
	}


	@Override
	public boolean perform() {
		if(lives == 1){
			if( getCoordinate().getY() < GraphicsParam.GAME_HEIGHT + getSprite().getHeight()/2){
				getCoordinate().setY(getCoordinate().getY()+5);
				return false;
			}
		}
//		System.out.println("ID "+ getEntityID() +" say: killed");
		return true;
	}
	
	
	@Override
	public boolean haveChild() {
		return false;
	}
	
	
	@Override
	public void hitted() {
		lives = 0;
	}
	
}
